import request from '@/utils/request'
// 保存流程
export function saveProcess(data) {
    return request({
      url: '/custom/process/saveProcess',
      method: 'post',
      data: data
    })
}
// 保存流程
export function updateProcess(data) {
    return request({
      url: '/custom/process/updateProcess',
      method: 'post',
      data: data
    })
}
// 获取流程列表
export function listProcess(data) {
    return request({
      url: '/custom/process/list',
      method: 'post',
      data: data
    })
}
// 根据流程id获取流程信息
export function getProcessInfo(processId) {
    return request({
      url: '/custom/process/getProcessInfo?id=' + processId,
      method: 'get',
    })
}
// 删除流程
export function deleteProcess(processId) {
    return request({
      url: '/custom/process/delete?id=' + processId,
      method: 'get',
    })
}
// 部署流程
export function deployProcess(id) {
  return request({
    url: '/custom/process/deploy?id=' + id,
    method: 'get',
  })
}
export function getX6GraphData(id) {
  return request({
    url: '/custom/process/getX6GraphData?instanceId=' + id,
    method: 'get',
  })
}
export function listHistoryGraphForInst(id) {
  return request({
    url: '/custom/process/listHistoryGraphForInst?instanceId=' + id,
    method: 'get',
  })
}
export function listHistoryForInst(id) {
  return request({
    url: '/custom/process/listHistoryForInst?instanceId=' + id,
    method: 'get',
  })
}
export function queryUserByName(userName) {
  return request({
    url: '/custom/process/user/queryUserByName?userName=' + userName,
    method: 'get',
  })
}
export function queryRoleByName(roleName) {
  return request({
    url: '/custom/process/user/queryRoleByName?roleName=' + roleName,
    method: 'get',
  })
}
export function queryDeptByName(deptName) {
  return request({
    url: '/custom/process/user/queryDeptByName?deptName=' + deptName,
    method: 'get',
  })
}
export function todoTaskList(data) {
  return request({
    url: '/activiti/process/todoTaskList',
    method: 'get',
    params: data
  })
}
export function doneTaskList(data) {
  return request({
    url: '/activiti/process/doneTaskList',
    method: 'get',
    params: data
  })
}
export function listTaskHistory(data) {
  return request({
    url: '/custom/process/listTaskHistory?instanceId='+data,
    method: 'get'
  })
}
